$(function(){
    
    $("#form").validate({
            //submitHandler: function(form) {
            //    $("#form_cadastro").submit();
            //},
            onfocusout: function (element) {
                $(element).valid();
            },
            rules: {
                    cad_email: { required: true, email: true},
            },

    });
    
    $('#cad_email').blur(function(){
        $.post(URLBASE+'/'+CONTROL+'/valemail', { email: $('#cad_email').val() }, function(data){                  
            if(!data.ok)
            {
                alert(data.msg);
                $('#cad_email').focus();
            }   
        }, 'json');
    });
});
